﻿using System.Runtime.CompilerServices;

namespace ConsoleApp;

public class DemoCaller
{
    /// <summary>
    /// 。
    /// </summary>
    /// <param name="message"></param>
    /// <param name="memberName">用于获取调用当前方法的成员名称</param>
    /// <param name="lineNumber">用于获取调用当前方法的代码行号</param>
    /// <param name="filePath">用于获取调用当前方法的文件路径</param>
    public void Log(string message, [CallerMemberName] string memberName = null, [CallerLineNumber] int lineNumber = 0, [CallerFilePath] string filePath = null)
    {
        Console.WriteLine($"Message: {message}, Called by: {memberName}");
    }
}